﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Page.master" AutoEventWireup="true" Inherits="ModelDetail" Codebehind="ModelDetail.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HtmlTitle" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ResultsPaneHeaderText" runat="Server">
    <script src="js/jquery.ui.combobox.js" type="text/javascript"></script>
    <style type="text/css">
	.ui-combobox {
		position: relative;
		display: inline-block;
	}
	.ui-button {
		position: absolute;
		top: 0;
		bottom: 0;
		margin-left: -1px;
		padding: 0;
		/* adjust styles for IE 6/7 */
		*height: 1.7em;
		*top: 0.1em;  
	}
	.ui-autocomplete-input {
		margin: 0;
		padding: 0.3em;
	}
	</style>
    <script type="text/javascript">
        $(function () {
           

           
        });
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ResultsPane" runat="Server">
   
    <div style="float: left">
        Fornitore:
        <asp:DropDownList ID="ddFornitori" runat="server" DataTextField="Fornitore" DataValueField="id">
        </asp:DropDownList>
    </div>
    <div style="text-align: center">
        Articoli:
        <asp:DropDownList ID="ddArticoli" runat="server" DataTextField="descrizione" DataValueField="id">
        </asp:DropDownList>
    </div>
    <div id="Modello">
        <div style="text-align: right">
            <asp:Button ID="btnFiltra" Text="Filtra" runat="server" CssClass="ui-widget ui-state-default ui-corner-all ui-button-text-only"
                OnClick="btnFiltra_Click" />
        </div>
         <asp:GridView ID="dispo" runat="server" DataKeyNames="id" AutoGenerateColumns="false"
            AllowPaging="true" PageSize="10" Width="80%" OnRowCommand="Associa">
            <Columns>
                <asp:BoundField HeaderText="Cod" DataField="CodArt" />
                <asp:BoundField HeaderText="Art" DataField="descrizione" />
                <asp:BoundField HeaderText="Prezzo" DataField="PrezzoUnitario" />
                <asp:BoundField HeaderText="U.M." DataField="DescUnitaMisura" />
                <asp:BoundField HeaderText="Iva" DataField="Iva" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:ImageButton ID="btnLink" runat="server" ImageUrl="Images/apply.png" CommandName="Associa"
                            CommandArgument='<%# Eval("id") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
         <div>
            Nome Modello :
            <asp:TextBox ID="nome" runat="server" MaxLength="50" /><asp:RequiredFieldValidator
                ID="RequiredFieldValidator1" runat="server" ErrorMessage="* Obbligatorio" ControlToValidate="nome"
                ValidationGroup="NuovoModello"></asp:RequiredFieldValidator><br />
            Descrizione :
            <asp:TextBox ID="descrizione" runat="server" MaxLength="50" TextMode="MultiLine"
                Rows="5" Columns="20" Width="425px"></asp:TextBox>
        </div>
       
        <asp:GridView ID="gvAssociati" runat="server" DataKeyNames="id" AutoGenerateColumns="false"
            AllowPaging="true" PageSize="10" Width="80%" OnRowCommand="DeAssocia">
            <Columns>
                <asp:BoundField DataField="id" Visible="false" />
                <asp:BoundField HeaderText="Cod" DataField="CodArt" />
                <asp:BoundField HeaderText="Art" DataField="descrizione" />
                <asp:BoundField HeaderText="Prezzo" DataField="PrezzoUnitario" />
                <asp:BoundField HeaderText="U.M." DataField="DescUnitaMisura" />
                <asp:BoundField HeaderText="Iva" DataField="Iva" />
                <asp:TemplateField HeaderText="Quantità">
                    <ItemTemplate>
                        <asp:TextBox ID="txtQTA" runat="server" Text='<%# Eval("Qta") %>'></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:ImageButton ID="btnLink" runat="server" ImageUrl="Images/delete.png" CommandName="DeAssocia"
                            CommandArgument='<%# Eval("id") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
       
    </div>
    <div id="btnArea">
            <asp:Button ID="btnSave" Text="Salva" runat="server" CssClass="ui-widget ui-state-default ui-corner-all ui-button-text-only"
                OnClick="SalvaModello"  />
             <asp:Button ID="Button1" Text="Converti" runat="server" CssClass="ui-widget ui-state-default ui-corner-all ui-button-text-only"
                OnClick="ConvertiModello"  />
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="TasksPaneHeaderText" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="TasksPane" runat="Server">
</asp:Content>

